package org.lease.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.lease.mapper.LabelInfoMapper;
import org.lease.model.entity.LabelInfo;
import org.lease.model.enums.ItemType;
import org.lease.service.LabelInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LabelInfoServiceImpl extends ServiceImpl<LabelInfoMapper, LabelInfo> implements LabelInfoService {
    @Override
    public List<LabelInfo> listByType(ItemType itemType) {
        LambdaQueryWrapper<LabelInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(itemType != null, LabelInfo::getType, itemType);
        return list(wrapper);
    }
}
